import { createApp } from 'vue'
import {createRouter,createWebHashHistory} from 'vue-router'
import './style.css'
import App from './App.vue'
import Home from "./pages/Home.vue";
import Goods from "./pages/Goods.vue";
import LIke from "./pages/LIke.vue";
import ClassRow from "./pages/ClassRow.vue";
import Index from "./pages/Index.vue";
import Me from "./pages/Me.vue";
import Cat from "./pages/Cat.vue";

// 实例化 定义路由
const router = createRouter({
    // 4. 内部提供了 history 模式的实现。为了简单起见，我们在这里使用 hash 模式。
    history: createWebHashHistory(),
    routes:[
        { path: '/', component: Index, children:[
                { path: '/', component: Home},
                { path: '/class', component: ClassRow},
                { path: '/cat', component: Cat},
                { path: '/me', component: Me},
            ] },
        { path: '/goods', component: Goods},
        { path: '/like', component: LIke},
        { path: '/classRow', component: ClassRow},
    ], // `routes: routes` 的缩写
})

// 挂载路由
createApp(App).use(router).mount('#app')
